<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-ng-model-cancel-update-jquery</title>
  

  <script src="../../components/jquery-2.1.1/jquery.js"></script>
  <script src="../../../angular.js"></script>
  <script src="app.js"></script>
  

  
</head>
<body ng-app="cancel-update-example">
    <div ng-controller="CancelUpdateController">
    <p>Try typing something in each input.  See that the model only updates when you
       blur off the input.
     </p>
     <p>Now see what happens if you start typing then press the Escape key</p>

    <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
      <p>With $rollbackViewValue()</p>
      <input name="myInput1" ng-model="myValue" ng-keydown="resetWithCancel($event)"><br/>
      myValue: "{{ myValue }}"

      <p>Without $rollbackViewValue()</p>
      <input name="myInput2" ng-model="myValue" ng-keydown="resetWithoutCancel($event)"><br/>
      myValue: "{{ myValue }}"
    </form>
  </div>
</body>
</html>